home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark09.i < prev    next >
Text File  |  1995-04-19  |  1KB  |  68 lines

  1.  
  2. Procedure Spark09;
  3. Const
  4.     max4lines = 40;
  5. Type
  6.     Sp1lines    = Array[1..max4lines] of line;
  7.     Sp1LinesPtr = ^Sp1Lines;
  8.  
  9. Var
  10.     arr    : Sp1LinesPtr;
  11.     cnt1,
  12.     cnt2,
  13.     cnt3,
  14.     cnt4,
  15.     CCNT,
  16.     add1,
  17.     add2,
  18.     add3,
  19.     add4,
  20.     actualline : Short;
  21. Begin
  22.     New(arr);
  23.     ActualLine := 1;
  24.  
  25.  
  26.     cnt1 := 546;    add1 := 7;    { x1 }
  27.     cnt2 := 3;    add2 := 3;    { y1 }
  28.     cnt3 := 197;    add3 := 13;    { x2 }
  29.     cnt4 := 401;    add4 := 7;    { y2 }
  30.     CCNT := 2;    { color }
  31.  
  32.     Repeat
  33.       EraseLine( Adr(arr^[actualline]) );
  34.       With arr^[actualline] do begin
  35.         x1 := 170 + XSin^[cnt1] *  6 DIV  5;    { +- max.120 }
  36.         y1 := 110 + Xsin^[cnt2] * 11 DIV 10;    { +- max.110 }
  37.         x2 := 160 + XSin^[cnt3] *  7 DIV  5;    { +- max.140 }
  38.         y2 := 120 + Xsin^[cnt4];            { +- max.100 }
  39.       end;
  40.  
  41.       cnt1 := cnt1 + add1;
  42.       if cnt1>627 then cnt1:= cnt1-628;
  43.  
  44.       cnt2 := cnt2 + add2;
  45.       if cnt2>627 then cnt2:= cnt2-628;
  46.  
  47.       cnt3 := cnt3 + add3;
  48.       if cnt3>627 then cnt3:= cnt3-628;
  49.  
  50.       cnt4 := cnt4 + add4;
  51.       if cnt4>627 then cnt4:= cnt4-628;
  52.  
  53.       DrawLine( Adr(arr^[actualline]), CCNT );
  54.  
  55.       inc( CCNT );
  56.       If CCNT > maxColors then CCNT := 2;
  57.  
  58.       inc( actualline );
  59.       If actualline >= max4lines then actualline := 1;
  60.  
  61.     Until LeftMouseButton;
  62.  
  63.     Ciao;
  64.     Dispose(arr);
  65.     SetSColors(Adr(Def_Colors));
  66. End;
  67.  
  68.